package dsf.eshop.commons.base;

import org.springframework.data.domain.Example;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;

import java.util.List;

public interface BaseService<T, ID> {

    List<T> listByPage(int page, int size);
    List<T> listByPage(int page, int size, Sort.Direction direction, String... properties);
    List<T> listByPage(Example example, int page, int size, Sort.Direction direction, String... properties);
    List<T> listByPage(Example<T> example, Pageable pageable);
    T detail(ID id);
    void save(T t);
    void delete(ID id);
}
